package com.expert.entity;

import java.io.Serializable;

import java.sql.Timestamp;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.expert.common.base.BaseModel;

/**
 * <p>
 * 
 * </p>
 *
 * @author Mankind
 * @since 2018-06-03
 */
public class Rule extends BaseModel<Rule> {

    private static final long serialVersionUID = 1L;

    /**
     * 特征集合,逗号分隔
     */
	private String facts;
    /**
     * 是否推导出结果
     */
    @TableField("endResult")
	private Boolean endResult;
    /**
     * 结果ID,如果是中间结果则为特征ID,如果是最终结果则为结果ID
     */
    @TableField("resultId")
	private Long resultId;

	@TableField(exist = false)
	private String condition;

	@TableField(exist = false)
	private String result;

	@TableField(exist = false)
	private boolean used;//是否使用
	@TableField(exist = false)
	private boolean possible;//是否可能
	@TableField(exist = false)
	private int nextFactPos;//记录下一次需验证的特征位置

	public boolean isUsed() {
		return used;
	}

	public void setUsed(boolean used) {
		this.used = used;
	}

	public boolean isPossible() {
		return possible;
	}

	public void setPossible(boolean possible) {
		this.possible = possible;
	}

	public int getNextFactPos() {
		return nextFactPos;
	}

	public void setNextFactPos(int nextFactPos) {
		this.nextFactPos = nextFactPos;
	}

	public String getCondition() {
		return condition;
	}

	public void setCondition(String condition) {
		this.condition = condition;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public String getFacts() {
		return facts;
	}

	public void setFacts(String facts) {
		this.facts = facts;
	}

	public Boolean getEndResult() {
		return endResult;
	}

	public void setEndResult(Boolean endResult) {
		this.endResult = endResult;
	}

	public Long getResultId() {
		return resultId;
	}

	public void setResultId(Long resultId) {
		this.resultId = resultId;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "Rule{" +
			"facts=" + facts +
			", endResult=" + endResult +
			", resultId=" + resultId +
			", createDate=" + createDate +
			", updateDate=" + updateDate +
			"}";
	}
}
